from core.room import Room
from core.basehandler import BaseHandler
from core.support import get_game

class Death(Room):
    
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
    
    # return description of room.
    def get_description(self):
        game = get_game()
        index = game.history[-2].get_id()
        if index =='lion_pride' :
            return 'Mauled by the pride, you should have walked away when you had the chance. You cheated death one too many times...GAME OVER'
        elif index == 'river1': 
            return "You can't swim with boots on you idiot and now are croc dinner...GAME OVER"
        elif index == 'river2':       
            return 'You are no Eagle scout, your sorry excuse for a raft fell apart and the hippos gladly played volleyball with your head...GAME OVER'
        elif index == 'river3':
            return "You can't swim with boots on you idiot and now are croc dinner...GAME OVER"
        elif index == 'river4':
            return "The villagers don't take kindly to strangers...GAME OVER."
        elif index == 'river5':
            return 'You should know better than to go fishing at a time like this. You deserve your death. GAME OVER'
        elif index == 'bush3':
            return "Not much chance to get by that guy...at least you are out of your misery... GAME OVER"
        else:
            return 'error'
    # return image of room
    def get_image(self):
        game = get_game()
        index = game.history[-2].get_id()
        if index =='lion_pride' :
            return 'death.jpg'
        elif index == 'river1': 
            return 'drowning.jpg'
        elif index == 'river2':       
            return 'hippo.jpg'
        elif index == 'river3':
            return 'drowning.jpg'
        elif index == 'river4':
            return 'witch_doctor.jpg'
        elif index == 'river5':
            return 'piranha.jpg'
        elif index == 'bush3':
            return 'death.jpg'
        else:
            return 'death.jpg'

class DeathHandler(BaseHandler):
    
    # override default template to omit the inventory and actions
    def get_template(self):
        return 'victory.html'
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return Death

# define actions for this room
